<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class UpdateColumnToColumnRecommendsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('column_recommends', function (Blueprint $table) {
            if (Schema::hasColumn('column_recommends', 'y_coordinate')) {
                $table->dropColumn('y_coordinate');
            }

            if (Schema::hasColumn('column_recommends', 'x_coordinate')) {
                $table->dropColumn('x_coordinate');
            }
            $table->string('area', 100)->nullable()->comment('区位信息');

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
